with BigNumberP; use BigNumberP;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Unchecked_Deallocation;

procedure P25 is

slot1 : BA := StringToBigNumber ("1");
slot2 : BA := StringToBigNumber ("1");
tempslot : BA;
index: Integer := 2;

procedure Delete_BigNumber is new Ada.Unchecked_Deallocation(BigNumber, BA);

begin

loop
   BigNumberAdd (slot1,slot2,tempslot);
   Delete_BigNumber(slot1);
   slot1 := slot2;
   slot2 := tempslot;
   index := index + 1;
   exit when BigNumberToString(tempslot)'Length = 1000;
end loop;

Put_Line(Integer'Image(index));

Delete_BigNumber(slot2);
Delete_BigNumber(slot1);

end P25;
